<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
</head>
<body>

	<h1>Hello world1</h1>

	<table class="table table-hover">
		<thead>
			<tr>
				<td>用户ID</td>
				<td>用户名</td>
				<td>性别</td>
				<td>邮箱</td>
				<td>角色</td>
			</tr>
		</thead>

		<c:forEach items="${pageInfo.list}" var="user">

			<tr>
				<td>${user.id}</td>
				<td>${user.username}</td>
				<td>${user.gender == "M" ? "男":"女"}</td>
				<td>${user.email}</td>
				<td>${user.role.rolename}</td>
			<tr>
		</c:forEach>

	</table>

	<div class="row">
		<div class="col-md-4 col-md-offset-4">
			<div style="margin:28px">
				第${pageInfo.pageNum}页，共${pageInfo.pages }页，共${pageInfo.total }条记录</div>
			</div>
			
		<div class="col-md-4">
			<nav aria-label="...">
				<ul class="pagination">

					<li><a href="/user/list/?pageNum=1"> 首页 </a></li>
					
					<c:if test="${pageInfo.hasPreviousPage }">
						<li><a href="/user/list/?pageNum=${pageInfo.pageNum -1 }" aria-label="Previous"> <span
							aria-hidden="true">&laquo;</span>
						</a></li>
					</c:if>
				

					<c:forEach items="${pageInfo.navigatepageNums }" var="page">

						<c:if test="${page == pageInfo.pageNum }">
							<li class="active">
								<a href="/user/list/?pageNum=${page } "> ${page } </a>
							</li>
						</c:if>

						<c:if test="${page != pageInfo.pageNum }">
							<li >
								<a href="/user/list/?pageNum=${page } "> ${page } </a>
							</li>
						</c:if>

					</c:forEach>
					
					<c:if test="${pageInfo.hasNextPage }">
						<li><a href="/user/list/?pageNum=${pageInfo.pageNum +1 }" aria-label="Next"> <span
							aria-hidden="true">&raquo;</span>
						</a></li>
					</c:if>
					
					
					<li><a href="/user/list/?pageNum=${pageInfo.pages }"> 末页 </a></li>
				</ul>
			</nav>

		</div>
	</div>



</body>
</html>